package gat.common.enums;

import com.fasterxml.jackson.annotation.JsonCreator;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @Author
 * @Date 2022/5/10
 * @Version 1.0
 */
@NoArgsConstructor
@AllArgsConstructor
@Getter
public enum PrivilegeEnums {

    QUERY_CONTACT("QUERY_CONTACT", "合作资源查看"),
    SUPER_TOP("SUPER_TOP", "超级置顶"),
    RECOMMEND_TOP("RECOMMEND_TOP", "推荐置顶"),
    ADVERTISING_OWNER("ADVERTISING_OWNER", "广告甲方置顶"),
    FLOW_PARTY_B("FLOW_PARTY_B", "流量乙方置顶"),

    TYPE_TOP("TYPE_TOP", "分类置顶"),
    TITLE_DISCOLOR("TITLE_DISCOLOR", "标题变色"),
    ADD_FRIEND("ADD_FRIEND", "添加人脉"),
    HIGH_QUALITY_GOODS_PUBLISH("HIGH_QUALITY_GOODS_PUBLISH", "优质货源发布"),
    SALE_CHANNEL_PUBLISH("SALE_CHANNEL_PUBLISH", "销售渠道发布"),
    RESOURCE_EXCHANGE_PUBLISH("RESOURCE_EXCHANGE_PUBLISH", "资源置换发布"),
    ADVERTISING_PUBLISH("ADVERTISING_PUBLISH", "广告甲方发布"),
    FLOW_PARTY_B_PUBLISH("FLOW_PARTY_B_PUBLISH", "流量乙方发布"),
    OVERSEAS_PUBLISH("OVERSEAS_PUBLISH", "海外业务发布"),
    FLOW_EXCHANGE_PUBLISH("FLOW_EXCHANGE_PUBLISH", "流量互换发布"),
    JOIN_IN_PUBLISH("JOIN_IN_PUBLISH", "招商加盟发布"),
    OFFLINE_ADVERTISING_PUBLISH("OFFLINE_ADVERTISING_PUBLISH", "线下广告发布"),
    OFFLINE_PLACE_PUBLISH("OFFLINE_PLACE_PUBLISH", "线下场地发布"),
    FREE_WELFARE_PUBLISH("FREE_WELFARE_PUBLISH", "免费福利发布"),
    NEW_MEDIA_TRANSFER_PUBLISH("NEW_MEDIA_TRANSFER_PUBLISH", "新媒体转让发布"),
    WEBSITE_TRANSFER_PUBLISH("WEBSITE_TRANSFER_PUBLISH", "网站转让发布"),
    DOMAIN_TRANSFER_PUBLISH("DOMAIN_TRANSFER_PUBLISH", "域名转让发布"),
    QUERY_COMPANY_CONTACT("QUERY_COMPANY_CONTACT", "查看企业联系方式"),
    QUERY_COMPANY_CREDIT("QUERY_COMPANY_CREDIT", "查看企业信用"),
    QUERY_COMPANY_INFO("QUERY_COMPANY_INFO", "查看经营信息"),
    QUERY_COMPANY_INTELLECTUAL_PROPERTY("QUERY_COMPANY_INTELLECTUAL_PROPERTY", "查看知识产权"),
    QUERY_COMPANY_BACKGROUND("QUERY_COMPANY_BACKGROUND", "查看企业背景")


    ;

    private String privilege;

    private String privilegeName;

    @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
    public static PrivilegeEnums getByPrivilege(String privilege) {
        for (PrivilegeEnums value : values()) {
            if (value.getPrivilege().equals(privilege)) {
                return value;
            }
        }
        return null;
    }

}
